package pikes.core;

import java.io.IOException;

/**
 * General interface representing text content. It can also be considered as an extended toString method.
 * @author Peter Bona
 */
public interface Printable {

	/**
	 * Prints the content to the character stream.
	 * @param appendable character stream
	 * @throws IOException when anything goes wrong with the character stream
	 */
	void print(Appendable appendable) throws IOException;

	/**
	 * Printable which prints nothing
	 */
	Printable EMPTY_PRINTABLE = new Printable() {

		public void print(final Appendable appendable) throws IOException {
			// do nothing
		}

	};
}
